//
//  LZRestaurantFilterCell.m
//  LzzizDemo
//
//  Created by xbnzd on 16/10/31.
//  Copyright © 2016年 xbnzd. All rights reserved.
//

#import "LZRestaurantFilterCell.h"
#import "LZLanguageManager.h"

@implementation LZRestaurantFilterCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    GET_SCREEN_SCALE(scale);
    self.layer.masksToBounds = NO;
    self.cellLabel.layer.cornerRadius = 4;
    self.cellLabel.layer.masksToBounds = YES;
    self.cellLabel.backgroundColor = UIColorFromRGB(0xf5f5f5, 1);
    self.cellLabel.font = [UIFont fontWithName:@"ArialMT" size:15*scale];
     self.cellLabel.textColor = UIColorFromRGB(0x333333, 1);
    
    if ([[LZLanguageManager shareInstance] getLanguageType] == kLanguage_AR) {
        self.cellIcon.image = [UIImage imageNamed:@"勾选_阿语"];
    }else{
        self.cellIcon.image = [UIImage imageNamed:@"勾选"];
    }
}

#pragma mark -
#pragma mark 加载数据
- (void)loadData:(NSString *)str
{
    self.cellLabel.text = str;
}

#pragma mark -
#pragma mark action  单选和多选写了两个方法的原因是,最初的版本选择效果不一样. UI改版改成了一样
- (void)showSelectedStateForRadio:(BOOL)selected
{
    if (selected) {
        self.cellLabel.backgroundColor = UIColorFromRGB(0xffffff, 1);
        self.cellLabel.layer.borderColor = UIColorFromRGB(0xff7a21, 1).CGColor;
        self.cellLabel.layer.borderWidth = 0.5;
        self.cellIcon.hidden = NO;

    }else{
        self.cellLabel.backgroundColor = UIColorFromRGB(0xf5f5f5, 1);
        self.cellLabel.layer.borderColor = UIColorFromRGB(0xf5f5f5, 1).CGColor;
        self.cellLabel.layer.borderWidth = 0;
        self.cellIcon.hidden = YES;
    }
    
}

- (void)showSelectedStateForMultiSelect:(BOOL)selected
{
    if (selected) {
        self.cellLabel.backgroundColor = UIColorFromRGB(0xffffff, 1);
        self.cellLabel.layer.borderColor = UIColorFromRGB(0xff7a21, 1).CGColor;
        self.cellLabel.layer.borderWidth = 0.5;
        self.cellIcon.hidden = NO;
    }else{
        self.cellLabel.backgroundColor = UIColorFromRGB(0xf5f5f5, 1);
        self.cellLabel.layer.borderColor = UIColorFromRGB(0xf5f5f5, 1).CGColor;
        self.cellLabel.layer.borderWidth = 0;
        self.cellIcon.hidden = YES;
    }
    
}


@end
